package com.chixing.Mapper;

import com.chixing.pojo.Order;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface OrderMapper {
    @Insert("insert into orders(cameras,quantity,totalPrice,status,statusText,createdAt,deliveredAt,seller,deliveryMethod,trackingNumber) values(#{cameras},#{quantity},#{totalPrice},#{status},#{statusText},#{createdAt},#{deliveredAt},#{seller},#{deliveryMethod},#{trackingNumber})")
    int insert(Order order);
    @Select("select * from orders order by createdAt DESC Limit #{start},#{pageSize}")
    List<Order> queryAllByLimit(int start, int pageSize);
}
